package com.bonc.rms.controller.tms;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.bonc.rms.service.tms.IAreaDistributionService;

@Controller
@RequestMapping(value = "/area")
public class AreaController {

	@Autowired
	IAreaDistributionService areaDistributionService;
	
	@ResponseBody
	@RequestMapping(value = "/show")
	public String getAreaDistribute(@RequestParam(value = "departmentId") Integer departmentId){
		Map<String, Object> result = new HashMap<>();
		result.put("status", 200);
		result.put("msg", "查询成功");
		result.put("area", areaDistributionService.getAreaDistribution(departmentId));
		return JSON.toJSONString(result);
	}
}
